//
//  PlayLayerUIScoreBoard.cpp
//  AvoidBlock
//
//  Created by 함 우식 on 12. 12. 25..
//
//

#include "PlayLayerUIScoreBoard.h"

using namespace cocos2d;

PlayLayerUIScoreBoard::PlayLayerUIScoreBoard()
{
    _pBg = CCSprite::spriteWithFile("scoreboard.png");
    _pBg->setPosition(ccp(0.0f, 0.0f));
    this->addChild(_pBg);
    
    _pLabel = CCLabelBMFont::labelWithString("0", "adamwarrenpro24_white.fnt");
    _pLabel->setAnchorPoint(ccp(0.5f, 0.5f));
    _pLabel->setPosition(ccp(0.0f, -10.0f));
    this->addChild(_pLabel);
}

void PlayLayerUIScoreBoard::setScore(int score)
{
    CCString* pStr = CCString::stringWithFormat("%d",score);
    _pLabel->setString(pStr->getCString());
}